package tongwentongshu.com.app.adapter;


import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import tongwentongshu.com.app.R;
import tongwentongshu.com.app.bean.MessageBean;
import tongwentongshu.com.app.bean.MyCollectionBean;
import tongwentongshu.com.app.utils.GlideUtil;

/**
 * 文 件 名: MainBooksAdapter
 * 创 建 人: Allen
 * 创建日期: 16/12/24 19:55
 * 邮   箱: AllenCoder@126.com
 * 修改时间：
 * 修改备注：
 */
public class MessageListAdapter extends BaseQuickAdapter<MessageBean.DataBean, BaseViewHolder> {
    private Context mContext;

    public MessageListAdapter(Context mContext, List<MessageBean.DataBean> list) {
        super(R.layout.view_message_list, list);
        this.mContext = mContext;

    }

    @Override
    protected void convert(BaseViewHolder helper, MessageBean.DataBean item) {
        helper.setText(R.id.tv_message_title, item.getTitle());
        helper.setText(R.id.tv_message_content, item.getContent());
        helper.setText(R.id.tv_message_time, item.getSend_time());
        ImageView status = (ImageView) helper.getView(R.id.iv_red_dot);
        if (item.getIs_read().equals("1")) {
            status.setVisibility(View.VISIBLE);
        } else {
            status.setVisibility(View.GONE);
        }
   }


}
